﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IronLua.Metadata
{
    public struct Local
    {
        internal Local(int index, string name, int begin, int end)
        {
            this.Index = index;
            this.ScopeBegin = begin;
            this.ScopeEnd = end;
            this.Name = name;
        }

        public readonly int     Index;
        public readonly string  Name;
        public readonly int     ScopeBegin;
        public readonly int     ScopeEnd;

        public override string ToString()
        {
            return "\"{0}\" (local {1} from line {2} to {3})"
                .FormatWith(this.Name, this.Index, this.ScopeBegin, this.ScopeEnd);
        }
    }
}
